integrated rln DoS protection into mix and ran basic scenarios successfully#3693
Draft
chaitanyaprem wants to merge 2 commits into
Draft
integrated rln DoS protection into mix and ran basic scenarios successfully#3693chaitanyaprem wants to merge 2 commits into
chaitanyaprem wants to merge 2 commits into
Conversation
chaitanyaprem
commented
Jan 23, 2026
| let uniqueTopicHandler = proc( | ||
| topic: PubsubTopic, msg: WakuMessage | ||
| ): Future[void] {.async, gcsafe.} = | ||
| # TODO: Why are all these synchronous in nature? wouldn't it be better to run them concurrently? |
Contributor
Author
There was a problem hiding this comment.
@Ivansete-status i have noticed that these topic handles are called one after the other.
I don't see any reason to not call them concurrently which might make relay message local processing faster.
|
You can find the image built from this PR at Built from a926778 |
6722406 to
c2b0629
Compare
Closed
3 tasks
0cd0581 to
5669cd5
Compare
eba5d43 to
aa9bbe3
Compare
|
This PR may contain changes to database schema of one of the drivers. If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues. Please make sure the label |
b44e51b to
45aad88
Compare
aa9bbe3 to
9ae3f04
Compare
45aad88 to
ee9eda2
Compare
9ae3f04 to
5de7d32
Compare
ee9eda2 to
5c814aa
Compare
5de7d32 to
30b1a16
Compare
a8fe3f3 to
ab123e4
Compare
4 tasks
2f478bb to
03bcaf1
Compare
1de6797 to
fb93fc7
Compare
5 tasks
fb93fc7 to
454a9f6
Compare
b9ffbfe to
3abe1d9
Compare
5b80bac to
7a5b09a
Compare
7d54103 to
6761b66
Compare
…rotection Rebased poc/mix-spam-protection onto origin/master. Bundles: - Extended kademlia discovery integration for mix node pool (waku/discovery/waku_kademlia.nim, tools/confutils/cli_args.nim) - RLN spam protection plugin (vacp2p/mix-rln-spam-protection) wired in: WakuMix gains mixRlnSpamProtection + publishMessage callback, per-hop proof generation / verification, membership coordination via /mix/rln/metadata/v1 content topic - chat2mix sim app: filter-subscribes to spam-protection coordination topic, defers publishing until mix node pool is populated - Makefile: automated librln_mix_v2.0.0.a build via scripts/build_rln_mix.sh and mix-librln target - simulations/mixnet: 5-node mixnet sim infrastructure (config1-4.toml, run_*.sh, build_setup.sh, setup_credentials.nim, README, roundtrip_check.sh automated round-trip verification) Rebase fixes: - Plugin previously vendored as submodule; now a nimble requires entry pinned to logos-co/mix-rln-spam-protection-plugin@037f8e10 - waku.nimble: zlib < 0.2 pin to keep nimble lock resolution stable (upstream zlib HEAD bumped to 0.2.0) - apps/chat2mix/config_chat2mix.nim: replace `defaultValue: parseIpAddress("...")` with IpAddress literal, works around confutils macro generating `defaultValueHelpName(): string {.raises: [].}` that violates the raises pragma when stringifying a parseIpAddress call - config.nims: nimble setup --noNimblePath reordering Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… retry
WakuMix.start() previously ran a single sequential pipeline that ended
with mixRlnSpamProtection.registerSelf() — which publishes the new
member's idCommitment to other mix nodes via relay. With master's flow
(switch.start() then reconnectRelayPeers() then ...), running registerSelf
inline would either:
- block startup for ~62s when reconnectRelayPeers backs off, or
- run before relay peers exist and silently no-op.
Split the start() proc into:
- method start*(WakuMix): local-only init (cred load, tree restore,
plugin start). Safe to await before peers are connected.
- proc registerDoSProtectionWithNetwork*(WakuMix): kick off a background
task that retries registerSelf + saveTree indefinitely until the
broadcast lands. Cancelled when WakuMix.stop() is invoked.
waku_node.start() now wires these in order:
switch.start()
wakuMix.start() # local init, errors propagate
reconnectRelayPeers() # may back off; no longer blocks mix
wakuMix.registerDoSProtectionWithNetwork() # fire-and-forget retry
node.started = true
Re-call safety: registerDoSProtectionWithNetwork no-ops if a prior task
is still running. Lifecycle: WakuMix.stop() cancelAndWait()s the task
before calling plugin.stop().
For keystore-loaded nodes the first attempt early-returns successfully
(membershipIndex already set); the retry path only exercises for fresh
joins where the initial broadcast hits a not-yet-subscribed network.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6761b66 to
f8ebf4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Still a work in progress.
This integrates RLN as spam protection mechanism to be used for mix.
As of now it uses OffChainGroupManager and logos-messaging for broadcasting membership changes and general coordination.
Rate limit is currently set to 100msgs per 10secs per node (any mix node).
Note that i don't want to merge this until we integrate RLN membership management with a smart contract in Logos blockchain is merged.
Dependency
This branch carries the extended kademlia discovery integration as one of its commits (cherry-picked from the original pre-rebase tip). That kademlia work is being delivered separately in #3850 (feat: kademlia discovery). Merge plan: this PR should not be merged until #3850 is merged + tested on master, after which this branch will be rebased on top of master and the duplicate kademlia content dropped.
Issue
closes #